const { base_url } = require('../utils/config');

//  刷新 token
exports.freshToken = async (data = {}) => {
  return new Promise( (resolve, reject) => {
    wx.request({
			url: base_url + "/wechat/api/fresh",
      method: "POST",
      data: {
        id: wx.getStorageSync('studentid'),
        token: wx.getStorageSync('token')
      },
      success: (res) => {
        resolve( res.data );
      },
      fail: reject
    })
  })
}